<script>


	$().ready(function() {
		// validate the comment form when it is submitted
		
		
		// validate signup form on keyup and submit
		$("#updateStudente").validate({
			rules: {
				matricola: {
					required: true,
					number: true
					},
					date: {
						required: true,
						date: true
						},
						

					nome: "required",
					cognome:"required"
								
						
		       		
			},
			messages: {
				matricola: {
					required: "inserisci la matricola",
					number: "il formato non e' corretto"
				},
				date: {
					required: "inserisci la data",
					date: "il formato non e' corretto"
				},
				
				nome: {
					required: "inserisci il nome"
						},
				cognome: {
						required: "inserisci il cognome"
						}
								
				
			}
		});
	});	
	Date.format = 'mm/dd/yyyy';
	$(function()
			{
		
		$('.date-pick').datePicker({startDate:'01/01/1996'});
			});
	
</script>

<div id="page">

<div id="content">

<form method="get" id="updateStudente"
	action="<?php echo BASE_PATH;?>Studente/Update_Studente/?">
<fieldset><legend>Modifica i dati:</legend>

<ol>
	<li><label for="nome">

		Matricola :</label>
		<input type="text" name="matricola" size="20" value="<?php echo $vars[Studente][0][Matricola];?>">
		</li>
	
	
		
	</li>
	<li><label for="nome">Data  di nascita:</label>
		<input type="text" title="date" name="date" id="sel" size="10" class="date-pick" value="<?php echo $vars[Studente][0]['Data di nascita']?>">
		</li>
		
	

		
	
			<li><label for="nome">Nome :</label>
		<input type="text" name="nome" size="30" value="<?php echo $vars[Studente][0][Nome];?>">
		</li>
		
	
	<li><label for="nome">Cognome :</label>
		<input type="text" name="cognome" size="30" value="<?php echo $vars[Studente][0][Cognome];?>">
		</li>
		
	<li><label for="nome">Anno Immatricolazione :</label>
			<select name="annoimm">
    <?php foreach ($vars['AnnoAccademico'] as $result){?>
    <option value="<?php echo $result['IdAnno'] ;?>"
    <?php if($result['datainizio'].'/'.$result['datafine']==$vars[Studente][0]['Anno immatricolazione']) echo 'selected=selected'; ?>>
    <?php echo $result['datainizio'].'/'.$result['datafine'];?></option>
  <?php }?>
  </select>
		</li>
		<li><label for="nome">
		Corso di Studio :</label>
			<select name="corsostudio">
    <?php foreach ($vars['CorsoStudio'] as $result){
    ?>
    <option value="<?php echo $result[IdCorsoStudio]; ?>" 
    <?php if($result[IdCorsoStudio]==$vars[Studente][0][Fk_IdCorsoStudio]) echo 'selected=selected'; ?>>
    <?php echo $result[Nome]; ?></option>
  <?php }?>
  </select>
  </li>
  </ol>
		<input type="submit" value="Modifica i dati">

		
</form>
</div>
</div>

<?php
if ($vars==1) {?>
<div class="insert"><?echo 'Modifica avvenuta con successo';}?></div>



